package com.cyufeng.blog.controller;

import com.cyufeng.blog.service.EmailSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 联系管理员
 * @author Cyufeng
 * Data:2018.12.30
 */

@CrossOrigin
@RequestMapping("/blog/email")
@RestController
public class EmailController {
    @Autowired
    EmailSerivce emailSerivce;

    /**
     * 保存邮件信息
     * Data：2018.12.30
     * @param title
     * @param detail
     * @param email
     * @return 成功（success）或者错误（error）
     */
    @GetMapping("/saveEmail")
    public String saveEmail(@RequestParam("title") String title,@RequestParam("detail") String detail ,@RequestParam("email") String email){
        return emailSerivce.saveEmail(title, detail, email);
    }
}
